package cn.tedu.egmybatis1.mapper;

import cn.tedu.egmybatis1.pojo.entity.Product;
import org.apache.ibatis.annotations.*;

@Mapper
public interface ProductMapper {

    @Insert("INSERT INTO product(title,price,stock) values (#{title},#{price},#{stock})")
    int InsertProduct(Product product);

    @Update("UPDATE product SET title=#{title} WHERE id=#{id} ")
    int UpdateProduct(Product product);

    @Select("SELECT id,title,price,stock FROM product ")
    Product SelectProduct();

    @Delete("DELETE FROM product WHERE id=#{id} ")
    void DeleteProduct(Product product);

}
